
namespace JTZY.Model.Business.Dto
{
    /// <summary>
    /// 用户余额表查询对象
    /// </summary>
    public class CorecmsuserbalanceQueryDto : PagerInfo
    {
        public long? userId { get; set; }

        public DateTime? beginCreateTime { get; set; }

        public DateTime? endCreateTime { get; set; }

        //记账类型
        public string typesAccount { get; set; }
        //业务类型
        public string biztype { get; set; }
    }

    /// <summary>
    /// 用户余额表输入输出对象
    /// </summary>
    public class CorecmsuserbalanceDto
    {
        [Required(ErrorMessage = "序列不能为空")]
        [ExcelColumn(Ignore = true)]
        public int Id { get; set; }

        [Required(ErrorMessage = "用户id不能为空")]
        [ExcelColumn(Ignore = true)]
        public long UserId { get; set; }

        [Required(ErrorMessage = "类型不能为空")]
        [ExcelColumn(Ignore =true)]
        public int Type { get; set; }

        [Required(ErrorMessage = "金额不能为空")]
        [ExcelColumn(Name ="收支金额",Index =1,Width =10)]
        public decimal Money { get; set; }

        [Required(ErrorMessage = "余额不能为空")]
        [ExcelColumn(Name ="账户结余", Index = 2, Width = 10)]
        public decimal Balance { get; set; }
        [ExcelColumn(Name ="订单编号", Index = 3, Width = 20)]
        public string SourceId { get; set; }
        [ExcelColumn(Name = "备注", Index = 8, Width = 10)]
        public string Memo { get; set; }

        [Required(ErrorMessage = "创建时间不能为空")]
        [ExcelColumn(Name ="记录时间", Index = 7, Width = 20, Format = "yyyy-MM-dd HH:mm:ss")]
        public DateTime? CreateTime { get; set; }
        [ExcelColumn(Ignore = true)]
        public int? ProductId { get; set; }
        [ExcelColumn(Name = "商品编码", Index = 4, Width = 10)]
        public string sn { get; set; }
        [ExcelColumn(Name = "商品名称", Index = 5, Width = 30)]
        public string Addon { get; set; }
        [ExcelColumn(Ignore = true)]
        public string ImageUrl { get; set; }

        [ExcelColumn(Name ="商品数量", Index = 6, Width = 10)]
        public int? Nums { get; set; }

        [ExcelColumn(Name = "业务类型", Index = 0, Width = 10)]
        public string TypeLabel {
            get{
                //{ dictLabel: '销售收入',dictValue: '9'},
                //             { dictLabel: '余额提现',dictValue: '4'},
                //             { dictLabel: '提现失败返还',dictValue: '12'},
                //             { dictLabel: '售后退款',dictValue: '11'}
                var label = "";
                switch(Type)
                {
                    case 9: label = "销售收入"; break;
                    case 4: label = "余额提现"; break;
                    case 12: label = "提现失败返还"; break;
                    case 11: label = "售后退款"; break;
                }
                return label;
            }
          }
        //public Corecmsuser CorecmsuserNav { get; set; }
        [ExcelColumn(Ignore =true)]
        public decimal? InAmount { get; set; } = 0;
        [ExcelColumn(Ignore = true)]
        public int InNums { get; set; } = 0;
        [ExcelColumn(Ignore = true)]
        public decimal? OutAmount { get; set; } = 0;
        [ExcelColumn(Ignore = true)]
        public int OutNums { get; set; } = 0;
    }
}